package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.BusContractCollectionMapper;
import com.ruoyi.business.domain.BusContractCollection;
import com.ruoyi.business.service.IBusContractCollectionService;

/**
 * 合同回款Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-09-02
 */
@Service
public class BusContractCollectionServiceImpl implements IBusContractCollectionService 
{
    @Autowired
    private BusContractCollectionMapper busContractCollectionMapper;

    /**
     * 查询合同回款
     * 
     * @param collectionId 合同回款主键
     * @return 合同回款
     */
    @Override
    public BusContractCollection selectBusContractCollectionByCollectionId(Long collectionId)
    {
        return busContractCollectionMapper.selectBusContractCollectionByCollectionId(collectionId);
    }

    /**
     * 查询合同回款列表
     * 
     * @param busContractCollection 合同回款
     * @return 合同回款
     */
    @Override
    public List<BusContractCollection> selectBusContractCollectionList(BusContractCollection busContractCollection)
    {
        return busContractCollectionMapper.selectBusContractCollectionList(busContractCollection);
    }

    /**
     * 新增合同回款
     * 
     * @param busContractCollection 合同回款
     * @return 结果
     */
    @Override
    public int insertBusContractCollection(BusContractCollection busContractCollection)
    {
        busContractCollection.setCreateTime(DateUtils.getNowDate());
        return busContractCollectionMapper.insertBusContractCollection(busContractCollection);
    }

    /**
     * 修改合同回款
     * 
     * @param busContractCollection 合同回款
     * @return 结果
     */
    @Override
    public int updateBusContractCollection(BusContractCollection busContractCollection)
    {
        busContractCollection.setUpdateTime(DateUtils.getNowDate());
        return busContractCollectionMapper.updateBusContractCollection(busContractCollection);
    }

    /**
     * 批量删除合同回款
     * 
     * @param collectionIds 需要删除的合同回款主键
     * @return 结果
     */
    @Override
    public int deleteBusContractCollectionByCollectionIds(Long[] collectionIds)
    {
        return busContractCollectionMapper.deleteBusContractCollectionByCollectionIds(collectionIds);
    }

    /**
     * 删除合同回款信息
     * 
     * @param collectionId 合同回款主键
     * @return 结果
     */
    @Override
    public int deleteBusContractCollectionByCollectionId(Long collectionId)
    {
        return busContractCollectionMapper.deleteBusContractCollectionByCollectionId(collectionId);
    }
}
